<!-- 日志清理天数设置页面   12.15  wcf全文添加--------------------------- -->
<template>
	<div class="all">
        <span class="title">定时删除设置</span>
         <div class="content">
            <div class="items">
              <div class="item-title">
                <!-- <span class="auto-delete">自动清理日志</span> -->
              </div>
              <div class="item">
                 <p>系统日志保留天数 </p>
                 <p> 
                    <input class="clear-active" type="tel" name="" id="" v-model=value1>
                    <span>天</span>
                </p>
              </div>

              <div class="item">
                 <p>电话录音文件保留天数</p>
                 <p> 
                    <input class="clear-active" type="tel" name="" id="" v-model=value2>
                    <span>天</span>
                </p>
              </div>

              
              
            </div>
            <div class="item-footer">
                <el-button type="primary" @click="savebtn">保存</el-button>
              </div>
         </div>

	</div>
</template>

<script type="text/babel">
	export default({
        data() {
			return {
                value1: '',
                value2: ''
			};
	
        },
        mounted(){
            this.getjournal()
        },
        methods:{
            getjournal() {
				var that = this
				var url = encodeURI(this.$url + '/getCleanCount')
				this.$http.get(url)
					.then(function(response) {
                        console.log(response);
                       
						if (response.data.code == '1410') {
                                that.$Toast(response.data.msg);
                                sessionStorage.setItem('token', '')
                                that.$router.push('/login')
							return
						}
                        that.value1=response.data.dailyRecord
						that.value2=response.data.telRecord
						
					})
					.catch(function(error) {
						console.log(error);
						that.$Toast('网络拥堵，刷新一下');
					});
			},
            // 提交保存
            savebtn(){
				var that = this
				var param = {
					dailyRecord:this.value1,
					telRecord:this.value2,
				}
				this.$http.post(this.$url + '/updateCleanCount', this.$qs.stringify(param))
					.then(function(response) {
                        console.log(response);
						if (response.data.code == '1410') {
							that.$Toast(response.data.msg);
							sessionStorage.setItem('token', '')
							that.$router.push('/login')
							return
						}else if(response.data.code == '0'){
                            that.$Toast('设置成功');
                            that. getjournal()
                        }
						
					})
					.catch(function(error) {
						// sessionStorage.setItem('token','undefined')
						// that.$router.push('/login')
						
						that.$Toast('网络拥堵，刷新一下');
					});
			},
        }
    })	
		
</script>
<style lang='less' scoped>
*{
    margin: 0px;
    padding: 0px;
    list-style: none;
    
}
.all{
    padding: 10px;
}
span{
    padding: 0px 10px;
}
.title{
    background-color: #fff;
    color: #000;
    display: inline-block;
    height: 48px;
    line-height: 48px;
    text-align: center;
    border-radius: 5px;
    border-bottom: none;
    font-size: 24px;
}
.content{
    width: 100%;
    //border-top:1px solid #DDDDDD ;
}
.items{
    // height: 500px;
    max-width: 600px;
    padding: 20px;
    padding-bottom: 20px;
    background-color: #fff;
    // border: 1px solid red;
    border-radius: 5px;
}
.header-delete{
    font-size: 14px;
}
.item-title{
    display: flex;
    justify-content: left;
    align-items: center;
}
.auto-delete{
    padding: 0 10px;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}
.clear-active{
    padding: 0px ;
    width: 50px;
    border: none ;
    text-align: center;
    font-weight: 400;
}
.clear-active:focus{
    outline: none;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.el-input__inner{
    padding: 0px !important;
}
.item{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #DDDDDD;
    padding: 10px 20px;
    border-radius: 5PX;
    color: #333;
    font-size: 14PX;
    margin-top:20px ;
   
}
.item p{
    overflow: hidden;
    // max-height: 30px;
}
.el-button--primary{
    margin-top: 10px;
    padding: 10px 15px;
}
.item-footer{
    width: 40%;
    padding: 0 20px;
   // text-align: center;
}
</style>
